package com.osleague.demo.service;

import com.osleague.demo.dao.UserDao;
import com.osleague.demo.domain.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;


/**
 * Created by Yif Zhan on 2015/10/29.
 */
@Service
public class UserService {

    @Resource
    private UserDao userDao;

    public User getUserById(long id) {
        return userDao.getUserById(id);
    }

    @Transactional
    public void addUser(User user) {
        userDao.addUser(user);
    }

}
